package bb.lanxing.service;

import android.os.Bundle;
import bb.lanxing.devices.sync.BiciSyncManager;
import bb.lanxing.devices.sync.BrytonSyncManager;
import bb.lanxing.devices.sync.DiscoveryHistroyManager;
import bb.lanxing.devices.sync.GenericDeviceSyncManager;
import bb.lanxing.devices.sync.IGSPortSyncManager;
import bb.lanxing.devices.sync.SprintNavigationSyncManager;
import bb.lanxing.devices.sync.SprintSyncManager;
import bb.lanxing.devices.sync.XZSprintHistorySyncManager;
import bb.lanxing.devices.sync.XZSprintMapSyncManager;
import bb.lanxing.devices.sync.XZSyncHelper;
import bb.lanxing.devices.sync.XossGHistoryManager;
import bb.lanxing.lib.devices.core.sync.SyncManager;
import bb.lanxing.lib.devices.core.sync.SyncManagerFactory;
import bb.lanxing.lib.devices.core.sync.SyncService;
import bb.lanxing.lib.devices.core.utils.DeviceHelper;
import bb.lanxing.lib.devices.sprint.sync.SprintMapManager;

public class AppSyncService extends SyncService implements SyncManagerFactory {
    @Override
    protected SyncManagerFactory getSyncManagerFactory() {
        return this;
    }

    @Override
    public SyncManager create(String str, String str2, Bundle bundle) {
        if (BrytonSyncManager.class.getName().equals(str)) {
            return new BrytonSyncManager();
        }
        if (IGSPortSyncManager.class.getName().equals(str)) {
            return new IGSPortSyncManager();
        }
        if (SprintSyncManager.class.getName().equals(str)) {
            return new SprintSyncManager(str2);
        }
        if (BiciSyncManager.class.getName().equals(str)) {
            return new BiciSyncManager();
        }
        if (GenericDeviceSyncManager.class.getName().equals(str)) {
            return new GenericDeviceSyncManager(str2);
        }
        if (SprintMapManager.class.getName().equals(str)) {
            return new SprintMapManager(getApplicationContext(), str2);
        }
        if (XZSprintMapSyncManager.class.getName().equals(str)) {
            return new XZSprintMapSyncManager(getApplicationContext(), str2);
        }
        if (SprintNavigationSyncManager.class.getName().equals(str)) {
            return new SprintNavigationSyncManager(str2);
        }
        if (XZSprintHistorySyncManager.class.getName().equals(str)) {
            return new XZSprintHistorySyncManager(str2, DeviceHelper.getWorkDir(9));
        }
        if (XZSyncHelper.DISCOVERY_SYNC_MANAGER_NAME.equals(str)) {
            return new DiscoveryHistroyManager(str2);
        }
        if (!XossGHistoryManager.class.getName().equals(str)) {
            return null;
        }
        return new XossGHistoryManager(str2);
    }
}
